let obj = {
  name: "张三",
  age: 18,
  sex: "男",
};

//实现创建一个对象，对象的原型指向的是obj的原型

function createObject(obj) {
  let newObj = {};
  Object.setPrototypeOf(newObj, obj);
  return newObj;
}

function createObj(obj) {
  function Fn() {}
  Fn.prototype = obj;
  let newObj = new Fn();
  return newObj;
}

let info = createObject(obj);

console.log(info.name);

let info2 = Object.create(obj);
